// @ts-ignore
/* eslint-disable */
import request from '@/request/request.ts'

/** 获取当前登录用户信息 GET /user/currentUser */
export async function getLoginUser(
  options ?: {[key: string]: any}
) {
  return request<API.BaseResponseUserVO>('/user/currentUser', {
  method: 'GET',
    ...(options || {}),
  });
}

/** 根据id获取用户 GET /user/getInfo */
export async function getInfo(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getInfoParams
    ,
  options ?: {[key: string]: any}
) {
  return request<API.BaseResponseUserVO>('/user/getInfo', {
  method: 'GET',
    params: {
        ...params,},
    ...(options || {}),
  });
}

/** 查询所有用户 POST /user/list */
export async function list(body: API.UserQueryRequest,
  options ?: {[key: string]: any}
) {
  return request<API.BaseResponsePageUser>('/user/list', {
  method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 用户登录 POST /user/login */
export async function userLogin(body: API.UserLoginRequest,
  options ?: {[key: string]: any}
) {
  return request<API.BaseResponseUserVO>('/user/login', {
  method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 用户退出登录 GET /user/logout */
export async function userLogout(
  options ?: {[key: string]: any}
) {
  return request<API.BaseResponseBoolean>('/user/logout', {
  method: 'GET',
    ...(options || {}),
  });
}

/** 用户注册 POST /user/register */
export async function userRegister(body: API.UserRegisterRequest,
  options ?: {[key: string]: any}
) {
  return request<API.BaseResponseLong>('/user/register', {
  method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 删除用户 POST /user/remove */
export async function remove(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.removeParams
    ,
  options ?: {[key: string]: any}
) {
  return request<API.BaseResponseBoolean>('/user/remove', {
  method: 'POST',
    params: {
        ...params,},
    ...(options || {}),
  });
}

/** 增加用户 POST /user/save */
export async function save(body: API.UserAddRequest,
  options ?: {[key: string]: any}
) {
  return request<API.BaseResponseLong>('/user/save', {
  method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 更新用户 POST /user/update */
export async function update(body: API.UserUpdateRequest,
  options ?: {[key: string]: any}
) {
  return request<API.BaseResponseBoolean>('/user/update', {
  method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

